package Cantella::DJabberd::Store::Result::VhostBridge;

use base qw(DBIx::Class::Core);
use metaclass 'Reaction::Meta::Class';
use Moose;

use MooseX::Types::Moose qw/Int/;
use aliased 'Cantella::DJabberd::Store::Result::Vhost';

use namespace::clean -except => [ 'meta' ];

#has vhost1_id => (isa => Int, is => 'rw', required => 1);
#has vhost2_id => (isa => Int, is => 'rw', required => 1);

__PACKAGE__->table('vhost_bridges');
__PACKAGE__->add_columns
  (
   vhost1_id => {
                 data_type => "INT",
                 size => 10,
                 is_nullable => 0,
                 extra => { unsigned => 1 },
                 is_foreign_key => 1,
                },
   vhost2_id => {
                 data_type => "INT",
                 size => 10,
                 is_nullable => 0,
                 extra => { unsigned => 1 },
                 is_foreign_key => 1,
                },
  );

__PACKAGE__->set_primary_key(qw/vhost1_id vhost2_id/);
#__PACKAGE__->belongs_to(vhost1 => Vhost, { id => "vhost1_id" });
#__PACKAGE__->belongs_to(vhost2 => Vhost, { id => "vhost2_id" });

sub display_name { }

__PACKAGE__->meta->make_immutable(inline_constructor => 0);

1;
